package com.mxpio.erp.inventory.provider;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.mxpio.erp.common.inventory.entity.WarehouseOrder;
import com.mxpio.erp.common.inventory.service.LotService;
import com.mxpio.erp.common.order.policy.OrderContext;
import com.mxpio.erp.common.order.provider.OrderContextProvider;

@Component
public class WarehouseOrderContextProvider implements OrderContextProvider {
	
	@Autowired
	private LotService lotService;

	@Override
	public boolean supports(Class<?> clazz) {
		if(clazz == WarehouseOrder.class) {
			return true;
		}
		return false;
	}

	@Override
	public void provide(OrderContext context) {
		context.setLotService(lotService);
	}

}
